<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var month = parseInt(prompt("请输入一个月份的数字"));
        switch (month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                alert ("这个月有31天");
                break;
            case 2:
                var year = parseInt(prompt("请输入年份的数字"));
                var i = year % 4;
                if (i === 0) {
                    alert ("这个月有29天");
                } else {
                    alert ("这个月有28天");
                }
                break;
            default:
                alert("这个月有30天");
        }
    </script>
</head>
<body>
    
</body>
</html>